package com.yolo.demo.controller;

import com.yolo.demo.feign.GoodsFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
@Slf4j
public class FileController {

    @Autowired
    private GoodsFeignClient goodsFeignClient;


    @PostMapping("/test")
    public String threeSeconds(@RequestPart(value = "file", required = false) MultipartFile file){
        String result = goodsFeignClient.handleFileUpload(file);
        log.info("feign接口调用结果{}",result);
        return result;
    }
}
